import axios from './http.js'
// 新增表容量
export function getLineAndAreaChart (level) {
  const url = '/overview/getLine'

  return axios.post(url, {
    time_level: level
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}
// 新增表容量和表数量以及各自的环比数据
export function getNewTableSizeAndNums () {
  const url = '/overview/getMain'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}
// 总库表信息
export function getTotalInfo () {
  const url = '/overview/getTotalInfo'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}
// 获取总库下主题信息
export function getThemeInfo () {
  const url = '/overview/getThemeInfo'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}
// 新增表容量排行
export function newAddSizeHotList () {
  const url = '/overview/getTableSizeRank'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}
// 新增表容量排行
export function getNewAddCurrentSizeHotList () {
  const url = '/overview/getTableCurrentSizeRank'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}
// 新增表数量排行
export function newAddNumsHotList () {
  const url = '/overview/getNewAddRank'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}
// 延迟查询
export function getQueryDelay () {
  const url = '/overview/getQueryDelay'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}
// 业务占用容量分布
export function getTakeCapPieChart () {
  const url = '/overview/getLogicViewDistribute'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 工作室/游戏占用容量分布
export function getStudioPieChart () {
  const url = '/overview/getStudioDistribute'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 获取表format类型数量饼图分布
export function getPieChartFormat () {
  const url = '/overview/getTblFormatType'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 获取表format类型容量饼图分布
export function getPieChartFormatSize () {
  const url = '/overview/getTblFormatTypeSize'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 工作室/游戏占用容量分布详情
export function getStudioDetail () {
  const url = '/overview/getStudioDetailDistribute'

  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}
